from abc import ABC, abstractmethod
from typing import List, Optional
from uuid import UUID

from .dto import RoleCreateDTO, RoleDTO, RoleUpdateDTO


class RoleFacade(ABC):
    """Role domain facade interface."""

    @abstractmethod
    async def create_role(self, role_data: RoleCreateDTO) -> RoleDTO:
        """Create a new role."""
        pass

    @abstractmethod
    async def get_role_by_id(self, role_id: UUID) -> Optional[RoleDTO]:
        """Get role by ID."""
        pass

    @abstractmethod
    async def get_role_by_name(self, name: str) -> Optional[RoleDTO]:
        """Get role by name."""
        pass

    @abstractmethod
    async def get_all_roles(self) -> List[RoleDTO]:
        """Get all roles."""
        pass

    @abstractmethod
    async def update_role(self, role_id: UUID,
                          role_data: RoleUpdateDTO) -> Optional[RoleDTO]:
        """Update role information."""
        pass

    @abstractmethod
    async def delete_role(self, role_id: UUID) -> bool:
        """Delete role by ID."""
        pass

    @abstractmethod
    async def get_child_roles(self, role_id: UUID) -> List[RoleDTO]:
        """Get all child roles of a role."""
        pass
